Thực đơn
Bigram Ví dụTừ một câu mẫu: "I go to school." sẽ cho ra nhiều dạng bigram khác nhau.
Mã python dành cho trường hợp bigram theo từ vựng với việc sử dụng thư viện NLTK.
import nltkword_data = "I go to school."nltk_tokens = nltk.word_tokenize(word_data) print(list(nltk.bigrams(nltk_tokens)))
Thực đơn
Bigram Ví dụLiên quan
Tài liệu tham khảo
WikiPedia: Bigram http://www.aclweb.org/anthology/P96-1025 //arxiv.org/abs/cmp-lg/9605012 //doi.org/10.3115%2F981863.981888